package worldinruin.gui.imp;

import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;

public class Messages {
	private static final String BUNDLE_NAME = "worldinruin.gui.imp.messages"; //$NON-NLS-1$
	
	Locale[] supportedLocales = {
		    new Locale("SV"),
		    Locale.ENGLISH
		};


	private static ResourceBundle RESOURCE_BUNDLE = ResourceBundle
			.getBundle(BUNDLE_NAME, Locale.getDefault());

	private Messages() {
	}
	
	public static void setLocale(Locale locale){
		RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME, locale);
	}

	public static String getString(String key) {
		try {
			return RESOURCE_BUNDLE.getString(key);
		} catch (MissingResourceException e) {
			return '!' + key + '!';
		}
	}
}
